home *** CD-ROM | disk | FTP | other *** search
/ Minami 78 / MINAMI78.iso / Extra / winamp53.exe / $R0 / Winamp Modern / scripts / notifier.maki (.txt) < prev    next >
Winamp Compiled Maki Script  |  2005-09-15  |  13KB  |  520 lines

  1. /* Note: a decompiler is no invitation to steal code.
  2.    Please respect the the copyright */
  3.  
  4. #include "std.mi"
  5. Global ConfigAttribute ConfigAttribute17;
  6. Global ConfigAttribute ConfigAttribute18;
  7. Global ConfigAttribute ConfigAttribute19;
  8. Global ConfigAttribute ConfigAttribute20;
  9. Global ConfigAttribute ConfigAttribute21;
  10. Global ConfigAttribute ConfigAttribute22;
  11. Global ConfigAttribute ConfigAttribute23;
  12. Global ConfigAttribute ConfigAttribute24;
  13. Global ConfigAttribute ConfigAttribute25;
  14. Global ConfigAttribute ConfigAttribute26;
  15. Global ConfigAttribute ConfigAttribute27;
  16. Global ConfigAttribute ConfigAttribute28;
  17. Global ConfigAttribute ConfigAttribute29;
  18. Global ConfigAttribute ConfigAttribute30;
  19. Global ConfigAttribute ConfigAttribute31;
  20. Global ConfigAttribute ConfigAttribute32;
  21. Global ConfigAttribute ConfigAttribute33;
  22. Global ConfigAttribute ConfigAttribute34;
  23. Global ConfigAttribute ConfigAttribute35;
  24. Global ConfigAttribute ConfigAttribute36;
  25. Global ConfigAttribute ConfigAttribute37;
  26. Global ConfigAttribute ConfigAttribute38;
  27. Global ConfigAttribute ConfigAttribute39;
  28. Global ConfigAttribute ConfigAttribute40;
  29. Global ConfigAttribute ConfigAttribute41;
  30. Global ConfigAttribute ConfigAttribute42;
  31. Global ConfigAttribute ConfigAttribute43;
  32. Global Container Container116;
  33. Global Layout Layout117;
  34. Global Timer Timer118;
  35. Global String String119;
  36.  
  37. Function func242();
  38. Function func2229();
  39. Function func2538(Int 0);
  40. Function func3163();
  41. Function func3205();
  42. Function func3380(Int 0);
  43. Function func3770(String "0");
  44. Function func5185(String "0");
  45.  
  46. func242()
  47. {
  48. ConfigItem ConfigItem52;
  49. ConfigAttribute ConfigAttribute77;
  50. ConfigItem ConfigItem71;
  51. ConfigItem ConfigItem58;
  52. ConfigItem ConfigItem61;
  53. ConfigItem ConfigItem67;
  54. ConfigAttribute ConfigAttribute75;
  55. ConfigAttribute ConfigAttribute73;
  56. ConfigItem ConfigItem46;
  57. ConfigAttribute ConfigAttribute72;
  58. ConfigAttribute ConfigAttribute84;
  59. ConfigAttribute ConfigAttribute79;
  60. ConfigItem ConfigItem64;
  61. ConfigAttribute ConfigAttribute78;
  62. ConfigItem ConfigItem49;
  63. ConfigItem ConfigItem69;
  64. ConfigAttribute ConfigAttribute74;
  65. ConfigItem ConfigItem55;
  66. ConfigItem46 = Config.newItem(( "Winamp\ Modern"), ( "\{26E26319\-AECA\-4433\-B8F1\-F4A5BF2A9ED5\}"));
  67. ConfigItem49 = Config.newItem(( "Drawers"), ( "\{C338B30F\-2A04\-4b10\-871F\-4E9D52D62806\}"));
  68. ConfigItem52 = Config.newItem(( "Menus"), ( "\{12ED320E\-6813\-45ac\-9F8E\-78EE5B2B5F6D\}"));
  69. ConfigItem55 = Config.newItem(( "Main\ Windowshade\ Mode"), ( "\{58F07E21\-AE96\-4899\-B7BC\-3640B40029FB\}"));
  70. ConfigItem58 = Config.newItem(( "Vis\ Buttons"), ( "\{D70E3ABF\-D2FF\-4b82\-9A70\-4B5DF1A5D942\}"));
  71. ConfigItem61 = Config.newItem(( "Notifications"), ( "\{1AB968B3\-8687\-4a35\-BA70\-FCF6D92FB57F\}"));
  72. ConfigItem64 = Config.newItem(( "Songticker"), ( "\{7061FDE0\-0E12\-11D8\-BB41\-0050DA442EF3\}"));
  73. ConfigItem67 = Config.newItem(( "Hidden"), ( "\{E9C2D926\-53CA\-400f\-9A4D\-85E31755A4CF\}"));
  74. ConfigItem69 = Config.getItem(( "\{1828D28F\-78DD\-4647\-8532\-EBA504B8FC04\}"));
  75. ConfigItem71 = Config.getItem(( "\{6559CA61\-7EB2\-4415\-A8A9\-A2AEEF762B7F\}"));
  76. ConfigAttribute72 = ConfigItem69.newAttribute(( "Winamp\ Modern"), ( ""));
  77. ConfigAttribute72.setData(( "\{26E26319\-AECA\-4433\-B8F1\-F4A5BF2A9ED5\}"));
  78. ConfigAttribute73 = ConfigItem46.newAttribute(( "Drawers"), ( ""));
  79. ConfigAttribute73.setData(( "\{C338B30F\-2A04\-4b10\-871F\-4E9D52D62806\}"));
  80. ConfigAttribute74 = ConfigItem46.newAttribute(( "Menus"), ( ""));
  81. ConfigAttribute74.setData(( "\{12ED320E\-6813\-45ac\-9F8E\-78EE5B2B5F6D\}"));
  82. ConfigAttribute75 = ConfigItem46.newAttribute(( "Main\ Windowshade\ Mode"), ( ""));
  83. ConfigAttribute75.setData(( "\{58F07E21\-AE96\-4899\-B7BC\-3640B40029FB\}"));
  84. ConfigAttribute77 = ConfigItem46.newAttribute(( "Vis\ Shortcut\ Button"), ( ""));
  85. ConfigAttribute77.setData(( "\{D70E3ABF\-D2FF\-4b82\-9A70\-4B5DF1A5D942\}"));
  86. ConfigAttribute78 = ConfigItem46.newAttribute(( "Notifications"), ( ""));
  87. ConfigAttribute78.setData(( "\{1AB968B3\-8687\-4a35\-BA70\-FCF6D92FB57F\}"));
  88. ConfigAttribute79 = ConfigItem46.newAttribute(( "Songticker"), ( ""));
  89. ConfigAttribute79.setData(( "\{7061FDE0\-0E12\-11D8\-BB41\-0050DA442EF3\}"));
  90. ConfigAttribute17 = ConfigItem49.newAttribute(( "Animate\ Video\/Vis\ Drawer\ \(disabled\ if\ opacity\ \<\ 100\%\)"), ( "0"));
  91. ConfigAttribute18 = ConfigItem49.newAttribute(( "Animate\ Config\ Drawer"), ( "0"));
  92. ConfigAttribute84 = ConfigItem49.newAttribute(( "sep1"), ( ""));
  93. ConfigAttribute84.setData(( "\-"));
  94. ConfigAttribute21 = ConfigItem49.newAttribute(( "Open\ Video\/Vis\ from\ the\ top"), ( "0"));
  95. ConfigAttribute22 = ConfigItem49.newAttribute(( "Open\ Video\/Vis\ from\ the\ bottom"), ( "1"));
  96. ConfigAttribute23 = ConfigItem49.newAttribute(( "Bypass\ setting\ to\ keep\ in\ screen"), ( "1"));
  97. if(( ConfigAttribute21.getData() == ( "1"))) {
  98. ConfigAttribute21.onDataChanged();
  99. } else {
  100. ConfigAttribute22.onDataChanged();
  101. }
  102. ConfigAttribute25 = ConfigItem52.newAttribute(( "Show\ Menus\ in\ Main\ Window"), ( "1"));
  103. ConfigAttribute26 = ConfigItem52.newAttribute(( "Show\ Menus\ in\ Playlist\ Editor"), ( "1"));
  104. ConfigAttribute27 = ConfigItem52.newAttribute(( "Show\ Menus\ in\ Media\ Library"), ( "1"));
  105. ConfigAttribute84 = ConfigItem46.newAttribute(( "sep1"), ( ""));
  106. ConfigAttribute84.setData(( "\-"));
  107. ConfigAttribute19 = ConfigItem46.newAttribute(( "Detach\ Vis\ Window"), ( "0"));
  108. ConfigAttribute20 = ConfigItem46.newAttribute(( "Detach\ Video\ Window"), ( "0"));
  109. ConfigAttribute24 = ConfigItem71.newAttribute(( "Equalizer\ Alt\+G"), ( "0"));
  110. ConfigAttribute84 = ConfigItem46.newAttribute(( "sep2"), ( ""));
  111. ConfigAttribute84.setData(( "\-"));
  112. ConfigAttribute31 = ConfigItem46.newAttribute(( "Enable\ Beat\ Visualization"), ( "1"));
  113. ConfigAttribute28 = ConfigItem55.newAttribute(( "Link\ Position\ and\ Width"), ( "1"));
  114. ConfigAttribute29 = ConfigItem55.newAttribute(( "Link\ Position\,\ Unlink\ Width"), ( "0"));
  115. ConfigAttribute30 = ConfigItem55.newAttribute(( "Unlink\ Position\ and\ Width"), ( "0"));
  116. ConfigAttribute33 = ConfigItem58.newAttribute(( "Open\ Context\ Menu"), ( "1"));
  117. ConfigAttribute32 = ConfigItem58.newAttribute(( "Open\ Configuration"), ( "0"));
  118. ConfigAttribute36 = ConfigItem61.newAttribute(( "Show\ always"), ( "0"));
  119. ConfigAttribute35 = ConfigItem61.newAttribute(( "Show\ with\ windowshade\ and\ when\ minimized"), ( "0"));
  120. ConfigAttribute34 = ConfigItem61.newAttribute(( "Show\ only\ when\ minimized"), ( "0"));
  121. ConfigAttribute37 = ConfigItem61.newAttribute(( "Never\ show"), ( "1"));
  122. ConfigAttribute84 = ConfigItem61.newAttribute(( "sep1"), ( ""));
  123. ConfigAttribute84.setData(( "\-"));
  124. ConfigAttribute41 = ConfigItem61.newAttribute(( "Disable\ in\ fullscreen"), ( "1"));
  125. ConfigAttribute38 = ConfigItem67.newAttribute(( "Notifications\ fade\ in\ time"), ( "1000"));
  126. ConfigAttribute39 = ConfigItem67.newAttribute(( "Notifications\ fade\ out\ time"), ( "5000"));
  127. ConfigAttribute40 = ConfigItem67.newAttribute(( "Notifications\ display\ time"), ( "2000"));
  128. ConfigAttribute42 = ConfigItem64.newAttribute(( "Enable\ Songticker\ scrolling"), ( "1"));
  129. ConfigAttribute43 = ConfigItem64.newAttribute(( "Disable\ Songticker\ scrolling"), ( "0"));
  130. return Null;
  131. }
  132.  
  133. System.onScriptLoaded()
  134. {
  135. func242();
  136. Timer118 = ( new Timer);
  137. return Null;
  138. }
  139.  
  140. System.onScriptUnloading()
  141. {
  142. delete Timer118;
  143. return Null;
  144. }
  145.  
  146. Int System.onShowNotification()
  147. {
  148. String String120;
  149. if(func2538(1)) {
  150. return Null;
  151. }
  152. func3205();
  153. if(( System.getStatus() == 1)) {
  154. String120 = ( "Playing");
  155. }
  156. if(( System.getStatus() == ( - 1))) {
  157. String120 = ( "Playback\ Paused");
  158. }
  159. if(( System.getStatus() == 0)) {
  160. String120 = ( "Playback\ Stopped");
  161. }
  162. func3380(func3770(String120));
  163. complete;
  164. return 1;
  165. }
  166.  
  167. System.onTitleChange(String newtitle)
  168. {
  169. if(( String119 == newtitle)) {
  170. return Null;
  171. }
  172. if(( System.Strleft(newtitle, 1) == ( "\["))) {
  173. if(( ( System.Strleft(newtitle, 7) == ( "\[Buffer")) || ( System.Strleft(newtitle, 4) == ( "\[ICY")))) {
  174. return Null;
  175. }
  176. }
  177. String119 = newtitle;
  178. func2229();
  179. return Null;
  180. }
  181.  
  182. func2229()
  183. {
  184. if(func2538(0)) {
  185. return Null;
  186. }
  187. func3205();
  188. func3380(func3770(( "")));
  189. return Null;
  190. }
  191.  
  192. System.onPlay()
  193. {
  194. if(func2538(0)) {
  195. return Null;
  196. }
  197. func3205();
  198. func3380(func3770(( "Playing")));
  199. return Null;
  200. }
  201.  
  202. System.onPause()
  203. {
  204. if(func2538(0)) {
  205. return Null;
  206. }
  207. func3205();
  208. func3380(func5185(( "Playback\ Paused")));
  209. return Null;
  210. }
  211.  
  212. System.onResume()
  213. {
  214. if(func2538(0)) {
  215. return Null;
  216. }
  217. func3205();
  218. func3380(func3770(( "Resuming\ Playback")));
  219. return Null;
  220. }
  221.  
  222. System.onStop()
  223. {
  224. if(func2538(0)) {
  225. return Null;
  226. }
  227. func3205();
  228. func3380(func5185(( "End\ of\ Playback")));
  229. return Null;
  230. }
  231.  
  232. func2538(Int 0)
  233. {
  234. Container Container134;
  235. Layout Layout135;
  236. if(( ( ( ! Int132) && ( ConfigAttribute41.getData() == ( "1"))) && System.isVideoFullscreen())) {
  237. return 1;
  238. }
  239. if(( ConfigAttribute37.getData() == ( "1"))) {
  240. return 1;
  241. }
  242. if(( ( ConfigAttribute34.getData() == ( "1")) && ( ! System.isMinimized()))) {
  243. return 1;
  244. }
  245. if(( ConfigAttribute35.getData() == ( "1"))) {
  246. if(System.isMinimized()) {
  247. return 0;
  248. }
  249. Container134 = System.getContainer(( "main"));
  250. if(( ! Container134)) {
  251. return 1;
  252. }
  253. Layout135 = Container134.getCurLayout();
  254. if(( ! Layout135)) {
  255. return 1;
  256. }
  257. if(( Layout135.getId() != ( "shade"))) {
  258. return 1;
  259. }
  260. }
  261. return 0;
  262. }
  263.  
  264. Layout117.onTargetReached()
  265. {
  266. Int Int137;
  267. Int137 = Layout117.getAlpha();
  268. if(( Int137 == 255)) {
  269. Timer118.setDelay(System.StringToInteger(ConfigAttribute40.getData()));
  270. Timer118.start();
  271. } else {
  272. if(( Int137 == 0)) {
  273. func3163();
  274. }
  275. }
  276. return Null;
  277. }
  278.  
  279. Timer118.onTimer()
  280. {
  281. Timer118.stop();
  282. if(Layout117.isTransparencySafe()) {
  283. Layout117.setTargetA(0);
  284. Layout117.setTargetSpeed(( System.StringToInteger(ConfigAttribute39.getData()) / 1000));
  285. Layout117.gotoTarget();
  286. } else {
  287. func3163();
  288. }
  289. return Null;
  290. }
  291.  
  292. Layout117.onLeftButtonDown(int x, int y)
  293. {
  294. Timer118.stop();
  295. Layout117.cancelTarget();
  296. func3163();
  297. System.restoreApplication();
  298. System.activateApplication();
  299. return Null;
  300. }
  301.  
  302. func3163()
  303. {
  304. Container116.close();
  305. Container116 = Null;
  306. Layout117 = Null;
  307. return Null;
  308. }
  309.  
  310. func3205()
  311. {
  312. if(( Container116 == Null)) {
  313. Container116 = System.newDynamicContainer(( "notifier"));
  314. if(( ! Container116)) {
  315. return Null;
  316. }
  317. if(System.isDesktopAlphaAvailable()) {
  318. Layout117 = Container116.getLayout(( "desktopalpha"));
  319. } else {
  320. Layout117 = Container116.getLayout(( "normal"));
  321. }
  322. if(( ! Layout117)) {
  323. return Null;
  324. }
  325. } else {
  326. Layout117.cancelTarget();
  327. Timer118.stop();
  328. }
  329. return Null;
  330. }
  331.  
  332. func3380(Int 0)
  333. {
  334. Int Int147;
  335. Int Int149;
  336. Int145 = ( Int145 + 32);
  337. Int147 = ( ( ( System.getViewportWidth() + System.getViewportLeft()) - Int145) - 2);
  338. Int149 = ( ( ( System.getViewportHeight() + System.getViewportTop()) - 80) - 2);
  339. Layout117.resize(Int147, Int149, Int145, 80);
  340. if(Layout117.isTransparencySafe()) {
  341. Layout117.show();
  342. Layout117.setTargetA(255);
  343. Layout117.setTargetX(Int147);
  344. Layout117.setTargetY(Int149);
  345. Layout117.setTargetW(Int145);
  346. Layout117.setTargetH(80);
  347. Layout117.setTargetSpeed(( System.StringToInteger(ConfigAttribute38.getData()) / 1000));
  348. Layout117.gotoTarget();
  349. } else {
  350. Layout117.setAlpha(255);
  351. Layout117.show();
  352. Timer118.setDelay(System.StringToInteger(ConfigAttribute40.getData()));
  353. Timer118.start();
  354. }
  355. return Null;
  356. }
  357.  
  358. func3770(String "0")
  359. {
  360. String String182;
  361. String String172;
  362. String String176;
  363. Text Text159;
  364. Text Text163;
  365. Text Text155;
  366. Text Text165;
  367. Text Text157;
  368. Group Group153;
  369. Int Int151;
  370. Int Int152;
  371. String String184;
  372. Text Text161;
  373. Int151 = 0;
  374. Int152 = 0;
  375. Group153 = Layout117;
  376. Text155 = Group153.findObject(( "plentry"));
  377. Text157 = Group153.findObject(( "nexttrack"));
  378. Text159 = Group153.findObject(( "title"));
  379. Text161 = Group153.findObject(( "album"));
  380. Text163 = Group153.findObject(( "artist"));
  381. Text165 = Group153.findObject(( "endofplayback"));
  382. System.debugString(( ( "got\ callback\ for\ ") + System.getPlayItemString()), 0);
  383. if(( System.Strleft(System.getPlayItemString(), 7) == ( "http\:\/\/"))) {
  384. Int152 = 1;
  385. }
  386. if(Text165) {
  387. Text165.hide();
  388. }
  389. if(Text155) {
  390. Text155.setText(( ( System.integerToString(( System.getPlaylistIndex() + 1)) + ( "\/")) + System.integerToString(System.getPlaylistLength())));
  391. Text155.show();
  392. }
  393. if(Text157) {
  394. if(( String150 == ( ""))) {
  395. if(( ! Int152)) {
  396. if(( ! System.isVideo())) {
  397. Text157.setText(( "New\ track"));
  398. } else {
  399. Text157.setText(( "New\ video"));
  400. }
  401. } else {
  402. Text157.setText(( "On\ air"));
  403. }
  404. } else {
  405. Text157.setText(String150);
  406. }
  407. Text157.show();
  408. }
  409. if(Text159) {
  410. if(( ! Int152)) {
  411. Text159.setXmlParam(( "ticker"), ( "0"));
  412. Text159.setXmlParam(( "display"), ( ""));
  413. String172 = System.getPlayItemMetaDataString(( "title"));
  414. if(( String172 == ( ""))) {
  415. String172 = System.getPlayItemDisplayTitle();
  416. }
  417. String176 = System.getPlayItemMetaDataString(( "length"));
  418. if(( String176 != ( ""))) {
  419. String172 = ( String172 + ( ( ( "\ \(") + System.integerToTime(System.StringToInteger(String176))) + ( "\)")));
  420. }
  421. Text159.setText(String172);
  422. } else {
  423. Text159.setXmlParam(( "ticker"), ( "1"));
  424. Text159.setXmlParam(( "display"), ( "songtitle"));
  425. Text159.setText(( ""));
  426. }
  427. Text159.show();
  428. }
  429. if(Text163) {
  430. if(( ! Int152)) {
  431. if(System.isVideo()) {
  432. Text163.setText(( ""));
  433. } else {
  434. Text163.setText(System.getPlayItemMetaDataString(( "artist")));
  435. }
  436. } else {
  437. if(System.isVideo()) {
  438. Text163.setText(( "Internet\ TV"));
  439. } else {
  440. Text163.setText(( "Internet\ Radio"));
  441. }
  442. }
  443. Text163.show();
  444. }
  445. if(Text161) {
  446. if(( ( ! Int152) && ( ! System.isVideo()))) {
  447. Text161.setXmlParam(( "display"), ( ""));
  448. String182 = System.getPlayItemMetaDataString(( "album"));
  449. String184 = System.getPlayItemMetaDataString(( "track"));
  450. if(( ( String184 != ( "")) && ( String184 != ( "\-1")))) {
  451. String182 = ( String182 + ( ( ( "\ \(Track\ ") + String184) + ( "\)")));
  452. }
  453. Text161.setText(String182);
  454. } else {
  455. Text161.setText(( ""));
  456. Text161.setXmlParam(( "display"), ( "songinfo"));
  457. }
  458. Text161.show();
  459. }
  460. Int151 = Text163.getAutoWidth();
  461. if(( Int151 > Text161.getAutoWidth())) {
  462. Int151 = Text161.getAutoWidth();
  463. }
  464. if(( Int151 > Text159.getAutoWidth())) {
  465. Int151 = Text159.getAutoWidth();
  466. }
  467. if(( Int151 > 128)) {
  468. Int151 = 128;
  469. }
  470. if(( Int151 < ( System.getViewportWidth() / 4))) {
  471. Int151 = ( System.getViewportWidth() / 4);
  472. }
  473. return Int151;
  474. }
  475.  
  476. func5185(String "0")
  477. {
  478. Text Text195;
  479. Text Text194;
  480. Text Text191;
  481. Text Text196;
  482. Group Group190;
  483. Text Text192;
  484. Text Text193;
  485. Int Int197;
  486. Group190 = Layout117;
  487. Text191 = Group190.findObject(( "plentry"));
  488. Text192 = Group190.findObject(( "nexttrack"));
  489. Text193 = Group190.findObject(( "title"));
  490. Text194 = Group190.findObject(( "album"));
  491. Text195 = Group190.findObject(( "artist"));
  492. Text196 = Group190.findObject(( "endofplayback"));
  493. if(Text191) {
  494. Text191.hide();
  495. }
  496. if(Text192) {
  497. Text192.hide();
  498. }
  499. if(Text193) {
  500. Text193.hide();
  501. }
  502. if(Text195) {
  503. Text195.hide();
  504. }
  505. if(Text194) {
  506. Text194.hide();
  507. }
  508. if(Text196) {
  509. Text196.setText(String189);
  510. Int197 = Text196.getAutoWidth();
  511. Text196.show();
  512. if(( Int197 < 128)) {
  513. return Int197;
  514. }
  515. }
  516. return 128;
  517. }
  518.  
  519.  
  520.